<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>用户组管理</title>
		<script src="/fanke/Public/Admin/Js/jquery.js"></script>
		<style type="text/css">
			body{
				background:url('/fanke/Public/Admin/Images/w70.png') repeat;
			}
			table{
				border-collapse:collapse;
			}
			tr{
				height:50px;
				border-top:2px solid #f9f0e0;
			}
			tr:hover{
				background:#f9f0e0;
			}
			a{
				text-decoration:none;
			}
			th{
				color:#d39c59;
			}
		</style>
	</head>
	<body id="page_ing">
		<center style="height:50px;line-height:50px;"><b style="font-size:30px;color:#d39c59;">用户组管理</b></center>
		<center>
			<table width="1100">
				<tr>
					<th width="30"></th>
					<th width="30">ID</th>
					<th width="100">用户组名:</th>
					<th>用户组描述:</th>
					<th>管理用户权限</th>
					<th>发表评论权限</th>
					<th>网站管理权限</th>
					<th>发送消息权限</th>
					<th>发表文章权限</th>
					<th>文章管理权限</th>
					<th width="80">操作</th>
				</tr>
				<?php if(is_array($groups)): foreach($groups as $key=>$g): ?><tr>
						<td><input type="checkbox" name="sel[]" class="selector_group"/></td>
						<td align="center"><?php echo ($g["id"]); ?></td>
						<td><?php echo ($g["groupname"]); ?></td>
						<td><?php echo ($g["description"]); ?></td>
						<td align="center">
							<?php if($g["useradmin"] == 1): ?><img src="/fanke/Public/Admin/Images/right_small_icon.jpg" alt="">
							<?php else: ?>
								<img src="/fanke/Public/Admin/Images/false_small_icon.jpg" alt=""><?php endif; ?>
						</td>
						<td align="center">
							<?php if($g["commentadmin"] == 1): ?><img src="/fanke/Public/Admin/Images/right_small_icon.jpg" alt="">
							<?php else: ?>
								<img src="/fanke/Public/Admin/Images/false_small_icon.jpg" alt=""><?php endif; ?>
						</td>
						<td align="center">
							<?php if($g["webadmin"] == 1): ?><img src="/fanke/Public/Admin/Images/right_small_icon.jpg" alt="">
							<?php else: ?>
								<img src="/fanke/Public/Admin/Images/false_small_icon.jpg" alt=""><?php endif; ?>
						</td>
						<td align="center">
							<?php if($g["sendmessage"] == 1): ?><img src="/fanke/Public/Admin/Images/right_small_icon.jpg" alt="">
							<?php else: ?>
								<img src="/fanke/Public/Admin/Images/false_small_icon.jpg" alt=""><?php endif; ?>
						</td>
						<td align="center">
							<?php if($g["sendarticle"] == 1): ?><img src="/fanke/Public/Admin/Images/right_small_icon.jpg" alt="">
							<?php else: ?>
								<img src="/fanke/Public/Admin/Images/false_small_icon.jpg" alt=""><?php endif; ?>
						</td>
						<td align="center">
							<?php if($g["articleadmin"] == 1): ?><img src="/fanke/Public/Admin/Images/right_small_icon.jpg" alt="">
							<?php else: ?>
								<img src="/fanke/Public/Admin/Images/false_small_icon.jpg" alt=""><?php endif; ?>
						</td>
						<td align="center" width="70" style="font-size:14px;"><a href="/fanke/index.php/Admin/Group/mod/id/<?php echo ($g["id"]); ?>">修改</a>|<a href="/fanke/index.php/Admin/Group/del/id/<?php echo ($g["id"]); ?>">删除</a></td>
					</tr><?php endforeach; endif; ?>
				<tr>
					<td colspan="8">
						<input type="button" onclick="sel(1)" value="全选">
						<input type="button" onclick="sel(2)" value="反选">
						<input type="button" onclick="sel(3)" value="全不选">
						<!-- //搜索框 -->
						<form action="/fanke/index.php/Admin/Group/searchGroup" method="post" style="width:430px;float:right;">
							<span>
								<input type="search" name="keywords" style="width:230px;height:22px;margin-right:0px;" />
								<input type="submit" value="搜索" style="height:22px;width:60px;margin-left:0px;background:#d7a769;border:1px solid #a9a9a9;cursor:pointer;margin-left:-8px;font-weight:bold;" />
							</span>
						</form>
					</td>

					<td colspan="2" align="center"><?php echo ($page); ?></td>
					<td align="center"><a href="/fanke/index.php/Admin/Group/addgroup">添加用户组</a></td>
				</tr>
			</table>
		</center>
	</body>
	<script type="text/javascript">
		var inp = document.getElementsByClassName("selector_group");
		var len = inp.length;
		function sel(args) {

			//设置全选状态
			if (args == 1) {
				for (var i = 0; i < len; i++) {
					inp[i].checked = true;
				}
			}

			//设置反选状态
			if (args == 2) {
				for (var i = 0; i < len; i++) {
					inp[i].checked = !inp[i].checked;
				}
			}

			//设置全不选状态
			if (args == 3) {
				for (var i = 0; i <len; i++) {
					inp[i].checked = false;
				}
			}
		}

		//Ajax请求分页刷新页面
		function setPage(url) {
			$.get(url, function(data) {
				$("#page_ing").html(data);
			});
		}
	</script>
</html>